package com.tuanzi.loan.web.lazy.family;

import com.tuanzi.loan.business.service.family.FirstPartyPrepaymentService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.PartnerBalanceSearchRequest;
import com.tuanzi.loan.vo.response.family.PartnerBalanceSearchResponse;
import org.springframework.data.domain.Page;

/**
 * @author JinRuiyang 2017/11/21
 */
public class PartnerBalanceDataModel extends
        BaseLazyDataModel<PartnerBalanceSearchRequest, PartnerBalanceSearchResponse> {

    private FirstPartyPrepaymentService firstPartyPrepaymentService = SpringContextHolder.getBean(FirstPartyPrepaymentService.class);

    public PartnerBalanceDataModel(PartnerBalanceSearchRequest searchRequest) {
        super(searchRequest);
    }

    @Override
    protected Page<PartnerBalanceSearchResponse> doLoad(PageSearcher<PartnerBalanceSearchRequest> pageSearcher) {
        return firstPartyPrepaymentService.listPartnerBalance(pageSearcher);
    }
}